<?php

namespace App\Http\Controllers;

use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;

define("MINAPPID","wx88514b8c36ca8182");     //小程序appid
define("MINAPPSECRET","b306b197401509318c35e34e6d082d66");  //小程序密钥
define("MCH_ID","1618377002");
define("DESCRIPTION","pahrimbazar");
define("KEY","pahrim123pahrim123pahrim12312312");  //商户号密钥



define("ROOT_URL","https://blog.pahrim88.cn");

class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;

    public function success($data = [], $msg = '操作成功')
    {
        return json_encode([
            'err' => 0,
            'data' => $data,
            'msg' => $msg,
        ]);
    }

    public function error($msg = '操作失败', $err = 1, $data = [])
    {
        return json_encode([
            'err' => $err,
            'data' => $data,
            'msg' => $msg,
        ]);
    }

}
